﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using Common;

namespace TestWpf
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
#if DEBUG
        [System.Runtime.InteropServices.DllImport("kernel32.dll")]
        private static extern bool AllocConsole();
#endif

        private static bool IsStart = Convert.ToBoolean(ConfigurationSettings.AppSettings["IsStart"]);

        public App()
        {
#if DEBUG
            AllocConsole();
#endif
            if (!SelfStart.IsExistKey("TestWpf")&&IsStart)
            {
                SelfStart.SelfRunning(IsStart, "TestWpf", @"E:\GitHubProject\C#开发\DemoLib\DemoLib\TestWpf\bin\Debug\TestWpf.exe");
            }
            else if(SelfStart.IsExistKey("TestWpf")&&!IsStart)
            {
                SelfStart.SelfRunning(IsStart, "TestWpf", @"E:\GitHubProject\C#开发\DemoLib\DemoLib\TestWpf\bin\Debug\TestWpf.exe");
            }
        }
    }
}
